#include"process.h"
#include<string.h>
#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
#define NUM 101
#define STYTLE '#'
#define SPACE ' '
#define label '.'
#define pnum 6
void Flushprocess(double current,double total,double net)
{
   double rate = (current / total)* 100;
   char bar[NUM];
   memset(bar,'\0',sizeof(bar));
   for(int i = 0;i<=(int)rate;i++)
   {
      bar[i] = STYTLE;
   } 
   static int num = 0;
   ++num;
   num%=pnum;
   char flag[pnum+1];
   memset(flag,'\0',sizeof(flag));
   for(int i = 0;i<pnum;i++)
   {
     if(i < num) flag[i] = label;
     else flag[i] = SPACE;
   }
   printf("[%-100s][%.1lf%%]%s,下载速度：%.1lfmb/s,总计：1204mb\r",bar,rate,flag,net);
   fflush(stdout);
}

